//    Copyright (C) Kherty.  All rights reserved.
using System;
using OpenLS.Core.Serialization;

namespace OpenLS.Spreadsheet.Pivot
{
    class PivotTableStyle : IOfficeXmlSerializable
    {
        String _name;
        Boolean? _showRowHeaders;
        Boolean? _showColHeaders;
        Boolean? _showRowStripes;
        Boolean? _showColStripes;
        Boolean? _showLastColumn;
        private const string xmlName = "pivotTableStyleInfo";
        public void ReadXml(ReadContext context)
        {
            using (var c = context.Read(xmlName))
            {
                _name = c.GetOptionalString("name");
                _showRowHeaders = c.GetOptionalBoolean("showRowHeaders");
                _showColHeaders = c.GetOptionalBoolean("showColHeaders");
                _showRowStripes = c.GetOptionalBoolean("showRowStripes");
                _showColStripes = c.GetOptionalBoolean("showColStripes");
                _showLastColumn = c.GetOptionalBoolean("showLastColumn");
            }
        }
        public void WriteXml(WriteContext context)
        {
            using (var c = context.Write(xmlName))
            {
                c.SetOptionalString("name", _name);
                c.SetOptionalBoolean("showRowHeaders", _showRowHeaders);
                c.SetOptionalBoolean("showColHeaders", _showColHeaders);
                c.SetOptionalBoolean("showRowStripes", _showRowStripes);
                c.SetOptionalBoolean("showColStripes", _showColStripes);
                c.SetOptionalBoolean("showLastColumn", _showLastColumn);
            }
        }
    }



}